package com.hzit.mmcb.core.controller.api;


import com.alibaba.excel.EasyExcel;
import com.hzit.common.result.R;
import com.hzit.mmcb.core.pojo.dto.ExcelDict;
import com.hzit.mmcb.core.pojo.entity.Dict;
import com.hzit.mmcb.core.service.DictService;
import com.sun.deploy.net.URLEncoder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
 * <p>
 * 数据字典 前端控制器
 * </p>
 *
 * @author ljh
 * @since 2024-08-27
 */
@RestController
@RequestMapping("/api/core/dict")
@Api(tags = "字典查询")
public class ApiDictController {
    @Autowired
    private DictService dictService;

    @GetMapping("/findByDictCode/{code}")
    @ApiOperation("根据code寻找")
    public R findByPid(@PathVariable @ApiParam(value = "code",required = true) String code){
        List<Dict> list= dictService.findByCode(code);
        return R.ok().data("list",list);
    }
}

